<%@ page isELIgnored="false"%>
<%@ page language="java" contentType="text/html; charset=utf-8"  
    pageEncoding="UTF-8"%>  
<%@taglib prefix="s" uri="/struts-tags" %>

<jsp:include page="../../iframecommon.jsp"></jsp:include>
<script  type="text/javascript">
function xuan(){     	          
	           var pageSize=document.getElementById("choosePageSize");
	           //alert(${condition});
	           window.location.href="message_allMessage?checkCondition="+${condition}+"&page="+${page}+"&pageSize="+pageSize.value;
	           //window.open("message_allMessage?checkCondition="+${condition}+"&page="+${page}+"&pageSize="+pageSize.value);
	    
}
</script>
<div class="alert alert-info">
 <td><a href="message_allMessage?checkCondition=1"><span class="label label-warning">查看未读消息</span></a></td>
    <td><a href="message_allMessage?checkCondition=0"><span class="label label-success">查看已读消息</span></a></td>
<s:iterator value="pageBean">
      |           共<s:property value="allRow"/>条记录    
         共<s:property value="totalPage"/>页    
         当前第<s:property value="currentPage"/>页
</s:iterator>

</div>
   
<div class="table-responsive">
<table class="table">
<tr>
<td>序号</td>
<td>课程</td>
<td>消息通知</td>
<td>发送人</td>
<td>状态</td>
<td>发送时间</td>
</tr>
<s:iterator value="viewMessages" id="vm" status="st">

<tr>
<td>${st.index+1}</td>
<td><a href="message_notRead?messageid=${vm.id.messageid}&id=${vm.id.sid}">${vm.id.cname}${vm.id.receiverCsn}班</a></td>
<td><a href="message_notRead?messageid=${vm.id.messageid}&id=${vm.id.sid}">${vm.id.description}</a></td>
<td>${vm.id.realname}</td>
<s:if test="#vm.status==1">
<td><span class="label label-warning">未读</span></td>
</s:if>
<s:else>
<td><span class="label label-success">已读</span></td>
</s:else>
<td>${vm.id.time}</td>
</tr>
<%-- 

<tr>
<td>${st.index+1}</td>
<td><a href="message_notRead?messageid=${vm.id.messageid}&id=${vm.id.sid}">${vm.id.cname}${vm.id.receiverCsn}</a></td>
<td><a href="message_notRead?messageid=${vm.id.messageid}&id=${vm.id.sid}">${vm.id.description}</a></td>
<td>${vm.id.realname}</td>
<td>${vm.id.time}</td>
</tr>
 --%>
</s:iterator>
</table>
</div>

<s:iterator value="pageBean">
<div class="alert alert-success">
         <s:if test="%{currentPage == 1}">
           第一页  上一页
         </s:if>
         <!-- currentPage为当前页 -->
         <s:else>
           <a href="message_allMessage?pageSize=${pageSize}&checkCondition=${condition}&page=1">第一页</a>
           <a href="message_allMessage?pageSize=${pageSize}&checkCondition=${condition}&page=<s:property value="%{currentPage-1}"/>">上一页</a>
         </s:else>
    
         <s:if test="%{currentPage != totalPage}">
         <a href="message_allMessage?pageSize=${pageSize}&checkCondition=${condition}&page=<s:property value="%{currentPage+1}"/>">下一页</a>
         <a href="message_allMessage?pageSize=${pageSize}&checkCondition=${condition}&page=<s:property value="totalPage"/>">最后一页</a>
            </s:if>
    
         <s:else>
         下一页  最后一页
         </s:else>
         每页显示：
         <select name="choosePageSize" id="choosePageSize" onchange="xuan()">
         <option></option>
         <option value="3" >3</option>
         <option value="5">5</option>
         <option value="10">10</option>
         <option value="20">20</option>
         <option value="10000">全部</option>
        </select>
  
        </div>
         
</s:iterator>